<style>
    button.multiselect {
      margin-top: 5px;
    }
</style>

<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a href="<%= window.location.href %>">用户玩法统计</a>
            </li>
        </ol>
    </div>
</header>
<section id="content">
<div class="panel">
    <form class="form-horizontal">

        <div class="form-group">
            <div class="col-md-3 text-center" >
                <span>活跃</span>
                <input type="text" id="dateFilter" name="dateFilter" style="margin-top: 5px"
                       class="form-control text-center" value="<%= options.dateRange[0] %> ~ <%= options.dateRange[1] %>">
            </div>
            <div class="col-md-3 text-center" >
                <span>注册</span>
                <input type="text" id="dateFilter2" name="dateFilter2" style="margin-top: 5px"
                       class="form-control text-center" value="<%= options.createRange[0] %> ~ <%= options.createRange[1] %>">
            </div>
            <!--<div class="col-md-1" style="margin:  2px 10px; width: 100px;">-->
                <!--<label for="SearchType" class="field select">-->
                    <!--<select id="TopType" name="TopType"  data-field="type" class="field select"-->
                            <!--style=" margin-top:7px; width: 100px;height:35px">-->
                        <!--<option value="bigbang" <%= options.type == -1 ? 'selected' : '' %>>所有</option>-->
                        <!--<% _.each(LOTTERY_NAME, function(v, k){ %>-->
                            <!--<option value="<%= k %>" <%= options.type == k ? 'selected': '' %>><%= v %></option>-->
                        <!--<% }) %>-->
                    <!--</select>-->
                <!--</label>-->
            <!--</div>-->
            <div class="col-md-1" style="margin:  2px 10px; width: 100px;">
                <label for="SearchType" class="field select">
                    <select id="SearchType" name="SearchType" data-field="bet_type" class="field select"
                    style=" margin-top:7px; width: 100px;height:35px">
                        <option value="gain" <%= options.search_type == 'gain' ? 'selected' : '' %>>盈利</option>
                        <option value="pay" <%= options.search_type == 'pay' ? 'selected' : '' %>>参与</option>
                    </select>
                </label>
            </div>
            <% if(channels.length > 0){ %>
                <div class="col-md-1" style="margin:  2px 10px; width: 200px;">
                    <select id="chnFilter" class="from-control" multiple>
                        <% if(options.chn == null)options.chn = []; %>
                        <% _.each(channels, function(chn){ %>
                            <option value="<%= chn %>"  <%= options.chn.indexOf(chn) == -1 ? "" : "selected" %>> <%= chn || "null" %> </option>
                        <% }) %>
                    </select>
                </div>
            <% }else{ %>
                <label for="search" class="col-md-1 control-label">无可选渠道数据</label>
            <% } %>
            <div class="col-md-1" style="margin:  2px 10px; width: 100px;">
                <input type="button" id="search" style="margin-top: 5px" class="btn btn-primary btn-block form-control" value="提交">
            </div>
        </div>
    </form>
</div>

<div class="panel overflow">
    <table class="table table-striped fs13" id="main-list">
        <thead>
            <tr class="bg-light">
                <th class="sortable" data-field="rank">排名</th>
                <th>用户ID</th>
                <th>渠道号</th>
                <th class="sortable" data-field="registered_at">注册时间</th>
                <th class="sortable" data-field="total_pay">累计参与</th>
                <th class="sortable" data-field="total_gain">累计盈利</th>
                <th class="sortable" data-field="cq_ssc">重庆时时彩</th>
                <th class="sortable" data-field="js_ks">江苏快三</th>
                <th class="sortable" data-field="sd_11x5">山东11选5</th>
                <th class="sortable" data-field="tj_ssc">天津时时彩</th>
                <th class="sortable" data-field="xj_ssc">新疆时时彩</th>
                <th class="sortable" data-field="jx_11x5">江西11选5</th>
                <th class="sortable" data-field="gd_11x5">广东11选5</th>
                <th class="sortable" data-field="sh_11x5">上海11选5</th>
                <th class="sortable" data-field="gx_ks">广西快3</th>
                <th class="sortable" data-field="bj_pk10">北京pk10</th>
                <th class="sortable" data-field="ff_ssc">幸运分分彩</th>
                <th class="sortable" data-field="ff_pk10">幸运pk10</th>
                <th class="sortable" data-field="ff_11x5">幸运11选5</th>
                <th class="sortable" data-field="ff_ks">幸运快3</th>
                <th class="sortable" data-field="bull">百人牛牛</th>
                <th class="sortable" data-field="kfc">捉金鸡</th>
                <th class="sortable" data-field="fruit">水果机</th>
                <th class="sortable" data-field="lottery">大转盘</th>
                <th class="sortable" data-field="metis5503">龙虎斗</th>
                <th class="sortable" data-field="metis5502">超级6</th>
            </tr>
        </thead>
        <tbody class="admin-form">
            <% _.each(items, function(item){ %>
                <tr>
                    <td><%= item.rank %></td>
                    <td><a href="#stats/account/?id=<%= item._id %>"><%= item._id %></a></td>
                    <td><%= item.chn %></td>
                    <td><%= item.registered_at  %></td>
                    <td><%= parseFloat(item.total_pay || 0).toFixed(2) %></td>
                    <td><%= (item.total_gain || 0).toFixed(2)  %></td>
                    <td><%= (item.cq_ssc  || 0).toFixed(2)%></td>
                    <td><%= (item.js_ks || 0).toFixed(2) %></td>
                    <td><%= (item.sd_11x5  || 0).toFixed(2)%></td>
                    <td><%= (item.tj_ssc  || 0).toFixed(2)%></td>
                    <td><%= (item.xj_ssc  || 0).toFixed(2)%></td>
                    <td><%= (item.jx_11x5  || 0).toFixed(2)%></td>
                    <td><%= (item.gd_11x5  || 0).toFixed(2)%></td>
                    <td><%= (item.sh_11x5  || 0).toFixed(2)%></td>
                    <td><%= (item.gx_ks  || 0).toFixed(2)%></td>
                    <td><%= (item.bj_pk10  || 0).toFixed(2)%></td>
                    <td><%= (item.ff_ssc  || 0).toFixed(2)%></td>
                    <td><%= (item.ff_pk10  || 0).toFixed(2)%></td>
                    <td><%= (item.ff_11x5  || 0).toFixed(2)%></td>
                    <td><%= (item.ff_ks  || 0).toFixed(2)%></td>
                    <td><%= (item.bull  || 0).toFixed(2)%></td>
                    <td><%= (item.kfc || 0).toFixed(2) %></td>
                    <td><%= (item.fruit  || 0).toFixed(2)%></td>
                    <td><%= (item.lottery  || 0).toFixed(2)%></td>
                    <td><%= (item.metis5503 || 0).toFixed(2) %></td>
                    <td><%= (item.metis5502  || 0).toFixed(2)%></td>
                </tr>
            <% }) %>
        </tbody>
    </table>
</div>
</section>
